
package de.midnightdance.admin.ws.entities;

import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import de.cbf.util.ui.editentities.interfaces.IEditableEntity;
import de.midnightdance.admin.ws.entities.UuidHeader;


/**
 * <p>Java class for jagdTechnik complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="jagdTechnik">
 *   &lt;complexContent>
 *     &lt;extension base="{http://service.server.midnightdance.de/}uuidHeader">
 *       &lt;sequence>
 *         &lt;element name="name" 		type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="notizen" 	type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *          &lt;element name="vorteileNotwendig" type="{http://service.server.midnightdance.de/}vorteilDB" maxOccurs="unbounded" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/extension>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "jagdTechnik", propOrder = {
    "name",
    "notizen"
})
public class JagdTechnik
extends UuidHeader implements IEditableEntity
{
		public static final int PCE_INDEX_Name 		= 1;
		public static final int PCE_INDEX_Notizen 	= 2;

	    protected String name;
	    protected String notizen;
	    @XmlElement(nillable = true)
	    protected List<VorteilDB> vorteileNotwendig;
	    
	    @XmlTransient
	    protected PropertyChangeSupport propertyChangeSupport;

	    public JagdTechnik() {
			super();
			propertyChangeSupport = new PropertyChangeSupport(this);
			name 	= "";
			notizen = "";
		}
	    
		protected void takeOverEntityData(Object aOther) {
			if (aOther instanceof JagdTechnik) {
				JagdTechnik other 		= (JagdTechnik) aOther;			
				this.name		= other.name;
				this.notizen	= other.notizen;
			}
		}

		@Override
		public IEditableEntity cloneEntity() {
			JagdTechnik result = new JagdTechnik();
			result.takeOverEntityData(this);
			return result;
		}

		@Override
		public PropertyChangeSupport getPropertyChangeSupport() {		
			return propertyChangeSupport;
		}

		@Override
		public void takeOverValuesFrom(IEditableEntity entity)
				throws IllegalArgumentException {
			if (entity instanceof JagdTechnik) {
				JagdTechnik other = (JagdTechnik) entity;
				takeOverEntityData(other);
			}else{
				throw new IllegalArgumentException("Expected: "+JagdTechnik.class+", Got: "+entity.getClass());
			}		
		}
	    
	    /**
	     * Gets the value of the name property.
	     * 
	     * @return
	     *     possible object is
	     *     {@link String }
	     *     
	     */
	    public String getName() {
	        return name;
	    }

	    /**
	     * Sets the value of the name property.
	     * 
	     * @param value
	     *     allowed object is
	     *     {@link String }
	     *     
	     */
	    public void setName(String value) {
	    	if(value == null || value.equals(name))return;
			String oldName = name;
			name = value;
			propertyChangeSupport.fireIndexedPropertyChange("name", PCE_INDEX_Name, oldName, name);
	    }

		/**
		 * @return the notizen
		 */
		public String getNotizen() {
			return notizen;
		}

		/**
		 * @param notizen the notizen to set
		 */
		public void setNotizen(String value) {
			if(value == null || value.equals(notizen))return;
			String oldNotizen = notizen;
			notizen = value;
			propertyChangeSupport.fireIndexedPropertyChange("notizen", PCE_INDEX_Notizen, oldNotizen, notizen);
		}
		/**
	     * Gets the value of the vorteileNotwendig property.
	     * 
	     * <p>
	     * This accessor method returns a reference to the live list,
	     * not a snapshot. Therefore any modification you make to the
	     * returned list will be present inside the JAXB object.
	     * This is why there is not a <CODE>set</CODE> method for the vorteileNotwendig property.
	     * 
	     * <p>
	     * For example, to add a new item, do as follows:
	     * <pre>
	     *    getVorteileNotwendig().add(newItem);
	     * </pre>
	     * 
	     * 
	     * <p>
	     * Objects of the following type(s) are allowed in the list
	     * {@link VorteilDB }
	     * 
	     * 
	     */
	    public List<VorteilDB> getVorteileNotwendig() {
	        if (vorteileNotwendig == null) {
	            vorteileNotwendig = new ArrayList<VorteilDB>();
	        }
	        return this.vorteileNotwendig;
	    }
}
